3.309 \(\int \frac{\sec ^2(x)}{a+b \sin ^2(x)} \, dx\)

Optimal. Leaf size=39 \[ \frac{b \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)^{3/2}}+\frac{\tan (x)}{a+b} \]

[Out]

(b*ArcTan[(Sqrt[a + b]*Tan[x])/Sqrt[a]])/(Sqrt[a]*(a + b)^(3/2)) + Tan[x]/(a + b)

________________________________________________________________________________________

Rubi [A]  time = 0.0606788, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3191, 388, 205} \[ \frac{b \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)^{3/2}}+\frac{\tan (x)}{a+b} \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]^2/(a + b*Sin[x]^2),x]

[Out]

(b*ArcTan[(Sqrt[a + b]*Tan[x])/Sqrt[a]])/(Sqrt[a]*(a + b)^(3/2)) + Tan[x]/(a + b)

Rule 3191

Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, T
an[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\sec ^2(x)}{a+b \sin ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1+x^2}{a+(a+b) x^2} \, dx,x,\tan (x)\right )\\ &=\frac{\tan (x)}{a+b}+\frac{b \operatorname{Subst}\left (\int \frac{1}{a+(a+b) x^2} \, dx,x,\tan (x)\right )}{a+b}\\ &=\frac{b \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)^{3/2}}+\frac{\tan (x)}{a+b}\\ \end{align*}

Mathematica [A]  time = 0.0804537, size = 39, normalized size = 1. \[ \frac{b \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)^{3/2}}+\frac{\tan (x)}{a+b} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]^2/(a + b*Sin[x]^2),x]

[Out]

(b*ArcTan[(Sqrt[a + b]*Tan[x])/Sqrt[a]])/(Sqrt[a]*(a + b)^(3/2)) + Tan[x]/(a + b)

________________________________________________________________________________________

Maple [A]  time = 0.08, size = 38, normalized size = 1. \begin{align*}{\frac{\tan \left ( x \right ) }{a+b}}+{\frac{b}{a+b}\arctan \left ({ \left ( a+b \right ) \tan \left ( x \right ){\frac{1}{\sqrt{a \left ( a+b \right ) }}}} \right ){\frac{1}{\sqrt{a \left ( a+b \right ) }}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^2/(a+b*sin(x)^2),x)

[Out]

tan(x)/(a+b)+b/(a+b)/(a*(a+b))^(1/2)*arctan((a+b)*tan(x)/(a*(a+b))^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(a+b*sin(x)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.38485, size = 641, normalized size = 16.44 \begin{align*} \left [-\frac{\sqrt{-a^{2} - a b} b \cos \left (x\right ) \log \left (\frac{{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \,{\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (x\right )^{2} + 4 \,{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{3} -{\left (a + b\right )} \cos \left (x\right )\right )} \sqrt{-a^{2} - a b} \sin \left (x\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (x\right )^{4} - 2 \,{\left (a b + b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right ) - 4 \,{\left (a^{2} + a b\right )} \sin \left (x\right )}{4 \,{\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \cos \left (x\right )}, -\frac{\sqrt{a^{2} + a b} b \arctan \left (\frac{{\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a - b}{2 \, \sqrt{a^{2} + a b} \cos \left (x\right ) \sin \left (x\right )}\right ) \cos \left (x\right ) - 2 \,{\left (a^{2} + a b\right )} \sin \left (x\right )}{2 \,{\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \cos \left (x\right )}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(a+b*sin(x)^2),x, algorithm="fricas")

[Out]

[-1/4*(sqrt(-a^2 - a*b)*b*cos(x)*log(((8*a^2 + 8*a*b + b^2)*cos(x)^4 - 2*(4*a^2 + 5*a*b + b^2)*cos(x)^2 + 4*((
2*a + b)*cos(x)^3 - (a + b)*cos(x))*sqrt(-a^2 - a*b)*sin(x) + a^2 + 2*a*b + b^2)/(b^2*cos(x)^4 - 2*(a*b + b^2)
*cos(x)^2 + a^2 + 2*a*b + b^2)) - 4*(a^2 + a*b)*sin(x))/((a^3 + 2*a^2*b + a*b^2)*cos(x)), -1/2*(sqrt(a^2 + a*b
)*b*arctan(1/2*((2*a + b)*cos(x)^2 - a - b)/(sqrt(a^2 + a*b)*cos(x)*sin(x)))*cos(x) - 2*(a^2 + a*b)*sin(x))/((
a^3 + 2*a^2*b + a*b^2)*cos(x))]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec ^{2}{\left (x \right )}}{a + b \sin ^{2}{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)**2/(a+b*sin(x)**2),x)

[Out]

Integral(sec(x)**2/(a + b*sin(x)**2), x)

________________________________________________________________________________________

Giac [A]  time = 1.12551, size = 61, normalized size = 1.56 \begin{align*} \frac{b \arctan \left (\frac{a \tan \left (x\right ) + b \tan \left (x\right )}{\sqrt{a^{2} + a b}}\right )}{\sqrt{a^{2} + a b}{\left (a + b\right )}} + \frac{\tan \left (x\right )}{a + b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(a+b*sin(x)^2),x, algorithm="giac")

[Out]

b*arctan((a*tan(x) + b*tan(x))/sqrt(a^2 + a*b))/(sqrt(a^2 + a*b)*(a + b)) + tan(x)/(a + b)